import React, { Component } from 'react';
import { observer, inject } from "mobx-react";
import CreateTaskModal from './createTaskModal';
import CreateProjectModal from './createProjectModal';
import CreateContactModal from './createContactModal';

@inject(({ commonState }) => ({ commonState }))
@observer
class Creator extends Component {

    render() {
        const { onCloseCreateProjectModal, onCloseCreateTaskModal, onCloseCreateContactModal, commonState } = this.props;
        const { projectModal, taskModal, contactModal, projecttype, projectname } = commonState;
        return (
            <>
                <CreateProjectModal
                    show={projectModal}
                    projecttype={projecttype}
                    projectname={projectname}
                    onCancel={onCloseCreateProjectModal}
                />
                <CreateTaskModal
                    show={taskModal}
                    onCancel={onCloseCreateTaskModal}
                />
                <CreateContactModal
                    show={contactModal}
                    onCancel={onCloseCreateContactModal}
                />
            </>
        );
    }
}

export default Creator